package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.services.infrastructure.bean.ResourceBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ResourceMapper {
    /**
     * @mbg.generated
     */
    int insert(ResourceBean record);

    /**
     * @mbg.generated
     */
    int insertSelective(ResourceBean record);

    /**
     * @mbg.generated
     */
    ResourceBean selectByPrimaryKey(Integer permissionId);

    /**
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(ResourceBean record);

    /**
     * @mbg.generated
     */
    int updateByPrimaryKey(ResourceBean record);

    /**
     * 根据父id，获得下面的子级菜单
     *
     * @param pid
     * @return
     */
    List<ResourceBean> getResourceListByPid(@Param("pid") int pid, @Param("systemType") int systemType);

    /**
     * 根据父id，获得下面的子级菜单
     *
     * @param pid
     * @return
     */
    List<ResourceBean> getTabList(@Param("pid") int pid, @Param("systemType") int systemType, @Param("groupId") Integer groupId);


    /**
     * 获取符合条件的数据
     * @param param
     * @return
     */
    List<ResourceBean> getResourceListByParam(@Param("param") Map<String, Object> param);

    /**
     * 通过uri获取权限
     * @param uri
     * @return
     */
    List<ResourceBean> getResourceByUri(@Param("uri") String uri);

    /**
     * 通过uri获取权限
     * @param uri
     * @return
     */
    List<ResourceBean> getResourceTabByUri(@Param("uri") String uri,@Param("systemType") int systemType,@Param("groupId") int groupId);
}